package com.example.wacoffeegateway.utils;

import cn.hutool.jwt.JWT;

import java.util.Date;

public class JwtUtil {
    private static final String SECRET_KEY = "czwa";
    private static final long EXPIRATION_TIME = 1000*60*60*12;

    public static String generateJwt(String id,Object ID){
        return JWT.create()
                .setPayload(id,ID)
                .setExpiresAt(new Date(System.currentTimeMillis()+EXPIRATION_TIME))
                .setKey(SECRET_KEY.getBytes())
                .sign();
    }
}
